#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

namespace std
{
	void test_vector1()
	{
		vector<int> v1;
		vector<int> v2(100, 1);
		vector<int> v3(v2);
		v1.push_back(1);
		v1.push_back(2);
		v1.push_back(1);
		v1.push_back(1);
		for (size_t i = 0; i < v1.size(); ++i)
		{
			cout << v1[i] << " ";
		}

		cout << endl;

		vector<int>::iterator it = v1.begin();
		while (it != v1.end())
		{
			(*it)--;

			cout << *it << " ";
			++it;
		}
		cout << endl;

		for (auto e : v1)
		{
			cout << e << " ";

		}
		cout << endl;

	}




	void test_vector2()
	{
		vector<int> v1;
		vector<int> v2(100, 1);
		vector<int> v3(v2);
		v1.push_back(6);
		v1.push_back(2);
		v1.push_back(4);
		v1.push_back(1);

		//v1.resize(3);

		v1.push_back(7);
		less<int> ls;
		sort(v1.begin(), v1.end(),ls);
		for (auto e : v1)
		{
			cout << e << " ";

		}
		cout << endl;

		//greater<int> gt;
		sort(v1.begin(), v1.end(), greater<int>());
		for (auto e : v1)
		{
			cout << e << " ";

		}
		cout << endl;
	}
}

class Solution {
public:
	vector<vector<int>> generate(int numRows) {
		vector<vector<int>> vv;
		vv.resize(numRows);
		for (size_t i = 0; i < vv.size(); ++i)
		{
			vv[i].resize(i + 1, 0);
			vv[i].front() = vv[i].back() = 1;
		}

		for (size_t i = 0; i < vv.size(); ++i)
		{
			for (size_t j = 0; j < vv[i].size(); ++j)
			{
				if (vv[i][j] == 0)
				{
					vv[i][j] = vv[i - 1][j] + vv[i - 1][j - 1];
				}
			}
		}

		return vv;
	}
};

int main()
{
	std::test_vector2();

	return 0;
}